/*     */ package com.lmpop.trade.ti_inquiry_normal;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.dao.IbatisDbmImpl;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import com.lmpop.frame.util.RandomID;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_inquiry_normalInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_inquiry_normalInfo()
/*     */   {
/*  18 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  28 */     String trade_id = new RandomID().GenTradeId();
/*     */ 
/*  30 */     String yancodetip = map.getString("yancodetip");
/*     */ 
/*  32 */     String userrand = map.getString("userrand");
/*  33 */     String randcode = map.getString("randcode");
/*     */ 
/*  35 */     Ti_inquiry_normal ti_inquiry_normal = new Ti_inquiry_normal();
/*  36 */     ti_inquiry_normal.setTrade_id(trade_id);
/*  37 */     ti_inquiry_normal.setInfo_id(map.getString("info_id"));
/*  38 */     ti_inquiry_normal.setTitle(map.getString("title"));
/*  39 */     ti_inquiry_normal.setOrder_num(map.getString("order_num"));
/*  40 */     String req_price = map.getString("req_price");
/*  41 */     if ((req_price == null) || ("".equals(req_price)))
/*  42 */       req_price = "0.00";
/*  43 */     ti_inquiry_normal.setReq_price(req_price);
/*  44 */     ti_inquiry_normal.setContent(map.getString("content"));
/*  45 */     ti_inquiry_normal.setReq_date(map.getString("req_date"));
/*  46 */     ti_inquiry_normal.setReq_file(map.getString("req_file"));
/*  47 */     ti_inquiry_normal.setRe_name(map.getString("re_name"));
/*  48 */     ti_inquiry_normal.setReq_compname(map.getString("req_compname"));
/*  49 */     ti_inquiry_normal.setReq_email(map.getString("req_email"));
/*  50 */     ti_inquiry_normal.setReq_phone(map.getString("req_phone"));
/*  51 */     ti_inquiry_normal.setCust_id(map.getString("cust_id"));
/*  52 */     ti_inquiry_normal.setUser_id(map.getString("user_id"));
/*  53 */     ti_inquiry_normal.setRemark(map.getString("remark"));
/*  54 */     ti_inquiry_normal.setBiz_type(map.getString("biz_type"));
/*  55 */     String result_code = "0";
/*  56 */     String result_info = "";
/*  57 */     if ((userrand != null) && (!userrand.equals("")) && (!randcode.equals(""))) {
/*  58 */       if (userrand.trim().equals(randcode.trim())) {
/*     */         try {
/*  60 */           insert(dbmMgr, ti_inquiry_normal);
/*     */         } catch (ApplicationException e) {
/*  62 */           e.printStackTrace();
/*  63 */           result_code = "1";
/*     */         }
/*     */       } else {
/*  66 */         result_info = yancodetip;
/*  67 */         result_code = "1";
/*     */       }
/*     */     }
/*     */     else try {
/*  71 */         insert(dbmMgr, ti_inquiry_normal);
/*     */       } catch (ApplicationException e) {
/*  73 */         e.printStackTrace();
/*  74 */         result_code = "1";
/*     */       }
/*     */ 
/*     */ 
/*  79 */     map.setString("result_info", result_info);
/*  80 */     map.setString("result_code", result_code);
/*  81 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_inquiry_normal ti_inquiry_normal)
/*     */     throws ApplicationException
/*     */   {
/*  90 */     dbmMgr.update("insertTi_inquiry_normal", ti_inquiry_normal);
/*     */   }
/*     */ 
/*     */   public SysMap insert_lianhesw(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  96 */     String yancodetip = map.getString("yancodetip");
/*  97 */     String userrand = map.getString("userrand");
/*  98 */     String randcode = map.getString("randcode");
/*     */ 
/* 100 */     Ti_inquiry_normal ti_inquiry_normal = new Ti_inquiry_normal();
/* 101 */     ti_inquiry_normal.setTrade_id(map.getString("trade_id"));
/* 102 */     ti_inquiry_normal.setInfo_id(map.getString("info_id"));
/* 103 */     ti_inquiry_normal.setTitle(map.getString("title"));
/* 104 */     ti_inquiry_normal.setOrder_num(map.getString("order_num"));
/* 105 */     ti_inquiry_normal.setContent(map.getString("content"));
/* 106 */     ti_inquiry_normal.setRe_name(map.getString("re_name"));
/* 107 */     ti_inquiry_normal.setReq_compname(map.getString("req_compname"));
/* 108 */     ti_inquiry_normal.setReq_email(map.getString("req_email"));
/* 109 */     ti_inquiry_normal.setReq_phone(map.getString("req_phone"));
/* 110 */     ti_inquiry_normal.setCust_id(map.getString("cust_id"));
/* 111 */     ti_inquiry_normal.setUser_id(map.getString("user_id"));
/* 112 */     ti_inquiry_normal.setRemark(map.getString("remark"));
/* 113 */     ti_inquiry_normal.setBiz_type(map.getString("biz_type"));
/* 114 */     ti_inquiry_normal.setRsrv_str1(map.getString("rsrv_str1"));
/* 115 */     ti_inquiry_normal.setRsrv_str2("0");
/* 116 */     ti_inquiry_normal.setRsrv_str3(map.getString("rsrv_str3"));
/* 117 */     String result_code = "0";
/* 118 */     String result_info = "";
/*     */     try {
/* 120 */       float price = Float.parseFloat(map.getString("biz_price").toString());
/* 121 */       map.setString("price", String.valueOf(price));
/* 122 */       ti_inquiry_normal.setReq_price(String.valueOf(price));
/* 123 */       if ((userrand != null) && (!userrand.equals("")) && (!randcode.equals(""))) {
/* 124 */         if (userrand.trim().equals(randcode.trim())) {
/* 125 */           insert_lianhesw(dbmMgr, ti_inquiry_normal);
/*     */         } else {
/* 127 */           result_info = yancodetip;
/* 128 */           result_code = "1";
/*     */         }
/*     */       } else {
/* 131 */         result_info = "��֤�����벻��ȷ!";
/* 132 */         result_code = "1";
/*     */       }
/*     */     } catch (ApplicationException e) {
/* 135 */       e.printStackTrace();
/* 136 */       result_code = "1";
/*     */     }
/*     */ 
/* 139 */     map.setString("result_info", result_info);
/* 140 */     map.setString("result_code", result_code);
/* 141 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert_lianhesw(DbmInterf dbmMgr, Ti_inquiry_normal ti_inquiry_normal) throws ApplicationException {
/* 145 */     dbmMgr.update("insertTi_inquiry_normalByLhsw", ti_inquiry_normal);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 154 */     String pkid_string = map.getString("pkid");
/* 155 */     String result_code = "0";
/*     */     try {
/* 157 */       if (!pkid_string.equals("")) {
/* 158 */         String[] pkStr = pkid_string.split("\\|");
/* 159 */         for (int i = 0; i < pkStr.length; i++) {
/* 160 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/* 164 */       e.printStackTrace();
/* 165 */       result_code = "1";
/*     */     }
/* 167 */     map.setString("result_code", result_code);
/* 168 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 177 */     dbmMgr.update("deleteTi_inquiry_normal", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 186 */     Ti_inquiry_normal ti_inquiry_normal = new Ti_inquiry_normal();
/* 187 */     ti_inquiry_normal.setTrade_id(map.getString("trade_id"));
/* 188 */     ti_inquiry_normal.setInfo_id(map.getString("info_id"));
/* 189 */     ti_inquiry_normal.setTitle(map.getString("title"));
/* 190 */     ti_inquiry_normal.setOrder_num(map.getString("order_num"));
/* 191 */     ti_inquiry_normal.setReq_price(map.getString("req_price"));
/* 192 */     ti_inquiry_normal.setContent(map.getString("content"));
/* 193 */     ti_inquiry_normal.setReq_date(map.getString("req_date"));
/* 194 */     ti_inquiry_normal.setReq_file(map.getString("req_file"));
/* 195 */     ti_inquiry_normal.setRe_name(map.getString("re_name"));
/* 196 */     ti_inquiry_normal.setReq_compname(map.getString("req_compname"));
/* 197 */     ti_inquiry_normal.setReq_email(map.getString("req_email"));
/* 198 */     ti_inquiry_normal.setReq_phone(map.getString("req_phone"));
/* 199 */     ti_inquiry_normal.setRsrv_str1(map.getString("rsrv_str1"));
/* 200 */     ti_inquiry_normal.setRsrv_str2(map.getString("rsrv_str2"));
/* 201 */     ti_inquiry_normal.setRsrv_str3(map.getString("rsrv_str3"));
/* 202 */     ti_inquiry_normal.setCust_id(map.getString("cust_id"));
/* 203 */     ti_inquiry_normal.setIn_date(map.getString("in_date"));
/* 204 */     ti_inquiry_normal.setUser_id(map.getString("user_id"));
/* 205 */     ti_inquiry_normal.setRemark(map.getString("remark"));
/* 206 */     ti_inquiry_normal.setBiz_type(map.getString("biz_type"));
/*     */ 
/* 208 */     String result_code = "0";
/*     */     try {
/* 210 */       update(dbmMgr, ti_inquiry_normal);
/*     */     } catch (ApplicationException e) {
/* 212 */       e.printStackTrace();
/* 213 */       result_code = "1";
/*     */     }
/* 215 */     map.setString("result_code", result_code);
/* 216 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_inquiry_normal ti_inquiry_normal)
/*     */     throws ApplicationException
/*     */   {
/* 225 */     dbmMgr.update("updateTi_inquiry_normal", ti_inquiry_normal);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 235 */     Map ti_inquiry_normal = (Hashtable)obj;
/* 236 */     if (start == 0)
/* 237 */       start = 0;
/*     */     else {
/* 239 */       start = (start - 1) * limit;
/*     */     }
/* 241 */     ti_inquiry_normal.put("start", Integer.valueOf(start));
/* 242 */     ti_inquiry_normal.put("limit", Integer.valueOf(limit));
/* 243 */     return this.queryList.getList("getListByTi_inquiry_normalPage", ti_inquiry_normal);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 255 */     Map ti_inquiry_normal = (Hashtable)obj;
/* 256 */     List list = this.queryList.getList("getCountByObjTi_inquiry_normal", ti_inquiry_normal);
/* 257 */     int count = 0;
/* 258 */     if ((list != null) && (list.size() > 0)) {
/* 259 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 260 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 261 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 264 */     return count;
/*     */   }
/*     */ 
/*     */   public String getSumByObj(Object obj) {
/* 268 */     Map ti_inquiry_normal = (Hashtable)obj;
/* 269 */     List list = this.queryList.getList("getSumByObjTi_inquiry_normal", ti_inquiry_normal);
/* 270 */     String count = "";
/* 271 */     if ((list != null) && (list.size() > 0)) {
/* 272 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 273 */       if ((newsMap.get("sumnum") != null) && (!newsMap.get("sumnum").toString().equals(""))) {
/* 274 */         count = newsMap.get("sumnum").toString();
/*     */       }
/*     */     }
/* 277 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 286 */     return this.queryList.getList("getTi_inquiry_normalByPk", pk);
/*     */   }
/*     */ 
/*     */   public void updateTi_inquiry_normalOrderState(Map map)
/*     */   {
/* 291 */     DbmInterf dbmMgr = new IbatisDbmImpl();
/* 292 */     dbmMgr.updateSql("updateTi_inquiry_normalOrderState", map);
/*     */   }
/*     */ 
/*     */   public SysMap updateTi_inquiry_normalOrderDeal(DbmInterf dbmMgr, SysMap map) {
/* 296 */     Map ti_inquiry_normal = new Hashtable();
/* 297 */     ti_inquiry_normal.put("trade_id", map.getString("trade_id"));
/* 298 */     ti_inquiry_normal.put("rsrv_str2", map.getString("rsrv_str2"));
/*     */ 
/* 300 */     String result_code = "0";
/*     */     try
/*     */     {
/* 304 */       updateTi_inquiry_normalOrderDeal(ti_inquiry_normal);
/*     */     } catch (ApplicationException e) {
/* 306 */       e.printStackTrace();
/* 307 */       result_code = "1";
/*     */     }
/* 309 */     map.setString("result_code", result_code);
/* 310 */     return map;
/*     */   }
/*     */   public void updateTi_inquiry_normalOrderDeal(Map map) throws ApplicationException {
/* 313 */     DbmInterf dbmMgr = new IbatisDbmImpl();
/* 314 */     dbmMgr.updateSql("updateTi_inquiry_normalOrderDeal", map);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_inquiry_normal.Ti_inquiry_normalInfo
 * JD-Core Version:    0.6.0
 */